checkArrayIdx
Arrays Sandbox PanosP Revised

Checking if a Key Is in an Array

Problem
=======

We want to check if a given "key" is indexing
some array element in a given array.

Solution
========

Operator `in` just do the job in awk:
 
  ...
  if (x in a)
  	# x indexed element exists.
  else
  	# x indexed element doesn't exist.
 
To make a function for that simple check
is just a formal matter:

 function arrayKeyExists(arr, idx) {
 	return(idx in arr)
 }

Author
======

Panos Papadopoulos

